home *** CD-ROM | disk | FTP | other *** search
/ Nikkei Mac 20 / NIKKEI-MAC-CD-VOL-20-1998-12.ISO.7z / NIKKEI-MAC-CD-VOL-20-1998-12.ISO / オンラインソフト / 9.ウェブ作成ツール / HTML Grinder v3.35.sit / HTML Grinder v3.35 / Grinder Tools / Auto Indexer / background_3858.xml next >
Extensible Markup Language  |  1998-09-23  |  15KB  |  45 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>3858</id>
  5.     <filler1>0</filler1>
  6.     <bitmap>BMAP_2485.pbm</bitmap>
  7.     <cantDelete> <false /> </cantDelete>
  8.     <showPict> <true /> </showPict>
  9.     <dontSearch> <false /> </dontSearch>
  10.     <link rel="stylesheet" type="text/css" href="stylesheet_3127.css" />
  11.     <part>
  12.         <id>6</id>
  13.         <type>button</type>
  14.         <visible> <true /> </visible>
  15.         <reserved5> 0 </reserved5>
  16.         <reserved4> 0 </reserved4>
  17.         <reserved3> 0 </reserved3>
  18.         <reserved2> 0 </reserved2>
  19.         <reserved1> 0 </reserved1>
  20.         <enabled> <true /> </enabled>
  21.         <rect>
  22.             <left>0</left>
  23.             <top>294</top>
  24.             <right>19</right>
  25.             <bottom>312</bottom>
  26.         </rect>
  27.         <style>opaque</style>
  28.         <showName> <false /> </showName>
  29.         <highlight> <false /> </highlight>
  30.         <autoHighlight> <true /> </autoHighlight>
  31.         <sharedHighlight> <true /> </sharedHighlight>
  32.         <family>0</family>
  33.         <titleWidth>0</titleWidth>
  34.         <icon>29540</icon>
  35.         <textAlign>center</textAlign>
  36.         <font>Chicago</font>
  37.         <textSize>12</textSize>
  38.         <textStyle>plain</textStyle>
  39.         <name>Help</name>
  40.         <script>on mouseUpfullhelpend mouseUpon mouseenterhelper "Click here for more help for HTML Grinder."end mouseenter</script>
  41.     </part>
  42.     <name></name>
  43.     <script>on processif cd fld findtext is empty thenbeepanswer "There are no keywords specified. Click on 窶廸ew Keyword窶 and fill out the Keyword and Variations fields."send mouseup to cd btn "keywords"exit processelse if there is not a file (line 2 of cd fld indexfile) thenbeepanswer "Couldn't find the file that the index should be placed on. Click 窶彜elect Index File...窶 to choose a file."send mouseup to cd btn "Index File"exit processend ifrepeat with x = 1 to the number of lines in cd fld findTextset cursor to busyput "AutoIndexer" & x into thisglobalsetGlobal thisglobal,""end repeatpass processend processon converter thefile,thecontentsglobal totalchangesput cd fld "blabber" into blabber--GET THE INTERFACE ELEMENTS INTO THE SCRIPTif the hilite of cd btn "match case" is truethen put "casesensitive" into thecaserelse put empty into thecaserput the selectedtext of cd btn "on same page" into IndexWhat-- if "First" is in indexWhat-- then put "findonly,firstonly" into findmode-- elseput "findonly" into findmodeput cd fld findText into finderput thecontents into newcontentsput tab into idelim----INFO ABOUT THE FILE ITSELFget extractTaggedText(thecontents,"title") --Requires 3.03put line 1 of it into titlechunkput stripreturns(line 2 of it) into theTitle--put empty into contentswithnotags----K FOR KEYWORDrepeat with k=1 to the number of lines in finderput empty into allchangesput empty into thechangesput line k of finder into thisKeywordput "AUTINDX_" & k into linkNameput 1 into linknumput empty into LinkNamesForThisKeyword--set the itemdelimiter to idelimput item 1 of thisKeyword into keywordName--V FOR VARIATIONrepeat with v=1 to the number of items in thisKeywordset the itemdelimiter to idelimput item v of thisKeyword into searchforThisset the itemdelimiter to ","--if contentswithnotags is empty thenif searchforthis is not in newcontents thennext repeatend ifput tagFilter(theContents," ","text") into contentswithnotagselseif searchforthis is not in contentswithnotags thennext repeatend ifend ifput findreplace(contentswithnotags,searchforThis,,findmode,thecaser) into thechangesif char 1 to 6 of thechanges is "error:" then next repeat----RECORD THE CHUNKLENGTH WITH EACH SEARCHput length(searchforthis) -1 into chunklengthrepeat with x=1 to the number of lines in thechangesput "," & chunklength after line x of thechangesend repeatput thechanges &return after allchangesend repeat --VARIATIONS--put the number of lines in allchanges into numchangesif numchanges = 0 then next repeat--NOW SORT ALL THE CHANGESsort lines of allchanges ascending numeric by item 1 of each----TAKE OUT CHANGES THAT FALL INSIDE TITLE TAGrepeat with x=numchanges down to 1get item 1 of line x of allchangesif it >= item 1 of titlechunk AND it <= item 2 of titlechunkthen  delete line x of allchangesend repeat----ARE WE SUPPOSED TO TRACK EVERY INSTANCE, OR JUST THE FIRST?if "First" is in IndexWhatthen put line 1 of allchanges into allchangeselse if "Separated" is in IndexWhat thenput 500 into wordspaceput wordspace * 6 into charspaceput empty into newinstancelistput "-" & (charspace *2) into lastInstancerepeat with x =1 to numchangesput item 1 of line x of allchanges into thisInstanceif thisInstance - charspace >= lastInstancethen put line x of allchanges &return after newinstancelistput thisInstance into lastInstanceend repeatput newinstancelist into allchangesend ifput the number of lines in allchanges into numchanges----UPDATE THE TOTAL NUMBERadd numchanges to totalchanges----NOW PUT IN THE SCROLLING LINK CODEif the hilite of cd btn "create scrolling links" is true thenput 0 into laststartcharrepeat with x=numchanges down to 1if there is a window "grinding..." thenset cursor to busyif iconnum =1then put 3 into iconnumelse put 1 into iconnumset i3_name of window "grinding..." to "grinder"&iconnumend if----GET THE INFOput item 1 of line x of allchanges into startcharput startchar + item 5 of line x of allchanges into endchar----MAKE SURE IT'S NOT A REPEAT OF THE LAST ONE!if startchar= laststartchar thennext repeatsubtract 1 from totalchangeselse put startchar into laststartchar----GET THE WHOLE WORDput "1234567890abcdefghijklmnopqrstuvwxyz'" into alphanumsrepeat until char (startchar-1) of newcontents is not in alphanumsif startchar =1 then exit repeatsubtract 1 from startcharend repeatrepeat until char (endchar+1) of newcontents is not in alphanumsif endchar = length(newcontents) then exit repeatadd 1 to endcharend repeatput char startchar to endchar of newcontents into searchforthis----SEE IF IT'S ALREADY GOT A NAME LINK AROUND IT.put empty into existingNameif char startchar-1 of newcontents is ">" orツャchar endchar +1 to endchar+4 of newcontents  is "</a>" thenput startchar -1 into endoftagput endoftag into startoftagrepeat until char startoftag of newcontents is "<"if startoftag =1 then exit repeatsubtract 1 from startoftagend repeatput char startoftag to endoftag of newcontents into thetagif "<a " is in thetag and ("name=" is in thetag or "name =" is in thetag) then--already has a name linkget extractreference(thetag,"name")if char 1 to 6 of it is not "Error:"  then put line 1 of it into existingnameend ifend if----NOW PUT THE NAME LINK AROUND ITif existingName is empty thenput linkname into thislinknamerepeat until thislinkname is not in newcontentsadd 1 to linknumput linkname & "_" & linknum into thislinknameend repeatput thislinkname & idelim before LinkNamesForThisKeyword--SINCE WE'RE GOING FROM BOTTOM UP, WE NEED TO--BUILD THE LIST IN REVERSE ORDER...put "<a name=" & quote & thislinkname & quote &">" & searchforthis & "</a>" ツャinto stufftoAddput stufftoAdd into char startchar to endchar of newcontentsput char 1 to length(stufftoAdd) of blabber into char startchar to endchar of contentswithnotagselseput existingName & idelim before LinkNamesForThisKeywordend ifend repeat  --xend ifif last char of LinkNamesForThisKeyword is idelimthen delete last char of LinkNamesForThisKeywordif LinkNamesForThisKeyword is emptythen put "窶「" into LinkNamesForThisKeywordput keywordName & idelim & thefile & idelim & thetitle & idelim & LinkNamesForThisKeyword into newlinks--put "AutoIndexer" & k into thisglobalput getGlobal(thisglobal) into oldLinksput newlinks &return after oldLinkssetGlobal thisglobal,oldLinksget getGlobal(thisglobal)end repeat --k--if newcontents <> thecontents and newcontents is not emptythen ReplaceFile thefile,newcontentsput empty into newcontentsend converterfunction getglobal theglobalnameget "global" && theglobalnamedo itreturn the value of theglobalnameend getglobalon setglobal theglobalname,thevalueget "global" && theglobalnamedo itget "put thevalue into" && theglobalnamedo itend setglobalon alldoneglobal totalchangesput empty into allLinkInfo----GET MISC INFOput line 2 of cd fld indexfile into theIndexFileput the selectedtext of cd btn "Index Format" into theIndexFormatput the selectedtext of cd btn "Text Format" into theTextFormat--MAKE THE LINK HTML CODEput empty into allLinksset the itemdelimiter to tab----FIGURE OUT WHAT GOES BEFORE, AFTER, BETWEEN ALL THE LINKS--put "" into beforeLinksput " " into afterLinksput "" into beforeRepeatLinksput " " into afterRepeatLinksput "" into beforeKeywordput "" into afterKeywordput "" into beforeallKeysput "" into afterallKeysif theIndexFormat is "Keywords Only" thenif ordered is in theTextformatthen put return&"<li>" into beforeKeywordput " | " into beforeRepeatLinksif "<P>" is in theTextFormatthen put return& "<p>" into afterKeyWordelse put "<br>" into afterkeywordelse if theIndexFormat is "Keywords with Titles" then-- put "<b>" & keywordName &"</b>" into beforeKeywordput return&"<p>" into afterKeyWordif "<P>" is in theTextFormatthen put return&"<p>" into beforeLinkselse put "<br>" into beforeLinksput " | " into beforeRepeatLinksif "ordered" is in thetextFormat then--put return&"<li>" & beforeKeyword & return& "<ul>" into beforekeywordput return&"</ul>" before afterkeywordif "<P>" is in theTextFormatthen put return&"<p>" &return& "<li>" into beforeLinkselse put return& "<li>" into beforeLinks--put "<li>" after beforeLinksend ifelse if theIndexFormat is "Keywords with Titles (1 line)" then-- put "<b>" & keywordName &"</b> " into beforeKeywordif "<P>" is in theTextFormatthen put return&"<p>" into afterKeyWordelse put "<br>" into afterkeywordput " | " into beforeLinksput " - " into beforeRepeatLinksif ordered is in thetextFormat thenput return& "<li>" before beforekeywordend if-- else if theIndexFormat is "Titles Only" then-- if ordered is in thetextFormat-- then  put "<li>" into beforeLinks-- else put "<br>" into beforeLinks-- put " | " into beforeRepeatLinks-- put "<p>" into afterAllKeysend ifif "unordered" is in theTextFormat thenput "<ul>" into beforeallkeysput "</ul>" into afterallKeyselse if "ordered" is in theTextFormat thenput "<ol>" into beforeallkeysput "</ol>" into afterallKeysend if----GET INSTANCES FOUND FOR EACH KEYWORDrepeat with x=1 to the number of lines in cd fld "findText"-- set the itemdelimiter to tabset cursor to busyput "AutoIndexer" & x into thisglobalput getGlobal(thisGlobal) into thisKeywordinfosetGlobal thisGlobal,""put item 1 of thisKeywordinfo into keywordNameif theIndexFormat is not "Keywords Only" thenput "<b>" & keywordName &"</b> " into beforeKeywordend ifif "ordered" is in thetextFormat thenif theIndexFormat is "keywords with titles" thenput return&"<li>" & beforeKeyword & return& "<ul>" into beforekeywordelse if theIndexFormat is "Keywords with Titles (1 line)" thenput return& "<li>" before beforekeywordend ifend ifput empty into thisKeyLinks----SORT BY FILE TITLEsort lines of thiskeywordInfo by item 3 of eachrepeat with y=1 to the number of lines in thisKeywordinfoset cursor to busyput line y of thisKeywordinfo into thisfileinfoput item 2 of thisfileinfo into filepathput item 3 of thisfileinfo into filetitlerepeat with z=4 to the number of items in thisfileinfoput item z of thisfileinfo into thelinknameput relativepath(theIndexFile,filepath) into theHREFset the itemdelimiter to tab--FIGURE OUT HOW THE LINKS SHOULD READif theIndexFormat is "Keywords Only"then put keywordName into textToLinkelse put fileTitle into textToLink--IF THE LINK IS ALREADY THERE, THEN PUT # IN INSTEADif textToLink is in thisKeylinksthen put "#" into TextToLink--NOW PUT IN THE LINKif texttoLink is "#" thenput beforeRepeatLinks into thebeforeput afterRepeatLinks into theAfterelseput beforeLinks into thebeforeput afterLinks into theAfterend ifif theLinkName is not "窶「"then put "#" & thelinkname into scrollerelse put "" into scrollerput thebefore & "<a href=" & quote & theHREF & scroller & quote &">"ツャ& textToLink &"</a>" & theAfter after thisKeyLinksend repeatend repeatif thiskeylinks is not empty --EMPTY IF KEYWORD NOT FOUND ANYWHEREthen put beforeKeyword & return& thisKeyLinks & return & afterKeyword &return after allLinksend repeatput beforeallKeys & return& allLinks & return& afterallKeys into allLinks--set the itemdelimiter to ","get attachindex(allLinks,line 2 of cd fld indexfile)--get totalchanges&&"items were added to the index page."put "0" into totalchangessend "alldone it" to homie()end alldonefunction attachindex theIndex,thefileopen file thefileread from file thefile until eofclose file thefileput it into thecontents--put smartattach(thecontents,"<!--Index-->","<!--End of Index-->",theIndex,the selectedtext of cd btn "Append",cd fld texto) into newcontents--if char 1 to 6 of newcontents is "Error:"then return newcontentselseopen file thefilewrite newcontents to file thefileclose file thefilereturn ""end ifend attachindexon resetwheelput empty into cd fld findtextput empty into cd fld allkeywordsput empty into cd fld keywordput empty into cd fld variationssend "deselect" to this card--setdefaults--put empty into cd fld indexfileselect line 3 of cd btn "append"send mouseup to cd btn "Append"put "</body>" into cd fld textohide cd fld texto--send mouseup to cd btn "keywords"pass resetwheelend resetwheelon setdefaultsset the hilite of cd btn "Match Case" to falseset the hilite of cd btn "create scrolling links" to false--select line 1 of cd btn "On same page"send mouseup to cd btn "On same page"--select line 2 of cd btn "Index Format"send mouseup to cd btn "Index Format"--select line 4 of cd btn "Text Format"send mouseup to cd btn "Text Format"end setdefaults</script>
  44. </background>
  45.